|
Groovy JDK |
Method Summary | |
---|---|
boolean
|
asBoolean()
Coerce an Object array to a boolean value. |
Object
|
asType(Class clazz)
Converts the given array to either a List, Set, or SortedSet. |
Number
|
count(Object value)
Counts the number of occurrences of the given value inside this array. |
boolean
|
equals(List right)
Determines if the contents of this array are equal to the contents of the given list, in the same order. |
Collection
|
flatten()
Flatten an array. |
Object
|
inject(Object initialValue, Closure closure)
Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure. |
String
|
join(String separator)
Concatenates the toString() representation of each
items in this array, with the given String as a separator between each
item.
|
int
|
size()
Provide the standard Groovy size() method for an array.
|
String
|
toArrayString()
Returns the string representation of the given array. |
SpreadMap
|
toSpreadMap()
Creates a spreadable map from this array. |
String
|
toString()
Returns the string representation of this array's contents. |
Method Detail |
---|
public boolean asBoolean()
public Object asType(Class clazz)
clazz
- the desired class.public Number count(Object value)
compareTo(value) == 0
or equals(value)
).value
- the value being searched for.public boolean equals(List right)
false
if either collection is null
.right
- the list being compared.public Collection flatten()
public Object inject(Object initialValue, Closure closure)
initialValue
- an initialValue.closure
- a closure.public String join(String separator)
toString()
representation of each
items in this array, with the given String as a separator between each
item.separator
- a String separator.public int size()
size()
method for an array.public String toArrayString()
{1, 2, "a"}
.public SpreadMap toSpreadMap()
public String toString()
|
Groovy JDK |